package other.Other_homework;

import java.util.ArrayList;

public class Average_Red_packet implements Red_packet {
    @Override
    public ArrayList<Integer> divide(int Summoney, int count) {
        ArrayList<Integer> list = new ArrayList<>();
        int money = Summoney/count;
        int balance = Summoney%count;
        for (int i = 0; i < count; i++) {
            if(i!=count-1) {
                list.add(money);
            }
            else
            {
                list.add(money+balance);
            }
        }

        return list;
    }
}
